<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/common.css"/>
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/dl.css"/>
<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/css/jgxxgl1.css"/>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.pagination.js"></script>
<script src="${BASE_PATH}/static/js/jquery.lightbox_me.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="${BASE_PATH}/static/js/login.js"></script>		
<script type="text/javascript" src="${BASE_PATH}/static/js/jquery.form.js"></script>		
<script type="text/javascript" src="${BASE_PATH}/static/js/default.js"></script>		
<script type="text/javascript" src="${BASE_PATH}/static/js/ajaxupload.js"></script>		
<script type="text/javascript">
	RootDir="${BASE_PATH}";
	$(function(){
		//上传图片
		new AjaxUpload('#addLabProdPic', {
			action: '${BASE_PATH}/upload', 
			name: 'picFile',
			responseType: 'json',
			onSubmit : function(file , ext){
				if (ext && /^(jpg|png|bmp)$/.test(ext.toLowerCase())){
					this.setData({
						'picName': file
					});
				} else {
					alert("请上传格式为 jpg|png|bmp 的图片！");
					return false;				
				}
			},
			onComplete : function(file,response){
				if(response.error) {
					alert(response.error);
					return;
				}
				//允许多个
				ImageIDList.push(response.ID);
				ImageList.push(response);
				$('#img_id_list').val(ImageIDList.join());
				RefreshImagePanel();
			}		
		});
	})
	
	function AjaxSubmit()
    {  
    	var cValue =$("#form1").formSerialize();
        $.ajax({
            type: "POST",
            url: "${BASE_PATH}/res_course/save",
			dataType : "json",
			cache : false,
			data : cValue + "&no-cache=" + Math.round(Math.random() * 10000),
			success : onAfterSubmit
		});
	}
	
	function onAfterSubmit(ret) {
		//保存成功
		if (ret.Code == 1) {
			alert("数据保存成功！");
			window.location.reload();
			return;
		}

		if (ret.Code == 2) {
			alert("用户登录失败！");
			return;
		}

		//验证失败
		if (ret.Code == 3) {
			var vCtrlID = ret.ctrlID;
			var vMessage = ret.message;
			$("#" + vCtrlID).focus();
			alert(vMessage);
			return;
		}
	}	
</script>
<title>课程资源</title>
</head>
<body>
<!--head start-->
<#include "../common/myspacetop.ftl"/> 
<!--head end-->
<div class="fnav system_fnav">
   <ul>
      <li><a href="###" target="_top">首页</a></li>
      <li><span>></span></li>
      <li><a href="###" target="_top">我的预约</a></li>
      <li><span>></span></li>
      <li><a href="###" target="_top">所有预约</a></li>
   </ul>   
</div>
<div class="my-content">
   <#include "../common/left.ftl"/>
      <div class="coright"> 
      <h2 class="my-bt"><span>基础设施</span></h2>
      <div class="content-con">
        <form id="form1" method="post">
         <div class="content-con1">
            <span class="bttext">课程名称:</span><input type="text" id="res_title" name="res_title" />
         </div>
         <div class="content-con1" style="display:none">
            <span class="bttext">课程所属单位:</span><input type="text" id="res_recommandleve3l" name="res_recom3mandlevel" />
         </div>
         <div class="content-con1">
            <span class="bttext">授课教师:</span><input type="text" id="res_teacher" name="res_teacher"/>
         </div>
         <div class="content-con1">
            <span class="bttext">学科分类:</span>
            <select id="res_prozone" name="res_prozone">	
				<#list typeid_33_list as rowkey>  
           		<li><option value="${rowkey.code_name_id}">${rowkey.code_value}</option>
           		</#list>	
        	</select>
         </div>
         <div class="content-con3">
            <span class="bttext">适用对象:</span>
            <#list typeid_49_list as rowkey>  
	            <div>
	               <input name="res_recommandgroup" type="checkbox" checked="checked" value='${rowkey.code_value}' />${rowkey.code_value}
	            </div>
           	</#list>	
         </div>
         <div class="content-con1">
            <span class="bttext">适用年级:</span>
            <select id="res_recommandlevel" name="res_recommandlevel">	
				<#list typeid_39_list as rowkey>  
           		<li><option value="${rowkey.code_value}">${rowkey.code_value}</option>
           		</#list>	
        	</select>
         </div>
         <div class="content-con1">
            <span class="bttext">课程主要呈现方式:</span>
            <select id="res_viewtype" name="res_viewtype">	
				<#list typeid_40_list as rowkey>  
           		<li><option value="${rowkey.code_name_id}">${rowkey.code_value}</option>
           		</#list>	
        	</select>
         </div>
         <div class="content-con2">
            <span class="bttext">课程描述:</span><textarea id="res_instrument" name="res_instrument" ></textarea>
         </div>         
         <div class="content-con1">
            <span class="bttext">联系人:</span><input type="text" id="res_contact" name="res_contact" />
         </div>
         <div class="content-con1">
            <span class="bttext">联系电话:</span><input type="text" id="res_contact_phone" name="res_contact_phone"  />
         </div>
         <div class="content-con1">
            <span class="bttext">单次使用时间:</span><input type="text" id="res_singleusetime" name="res_singleusetime" />
         </div>
         <div class="content-con3">
            <span class="bttext">课程教材或教案:</span>
            <div>
               <input name="res_hascoursedoc" type="radio" checked="checked" value="1" />有
            </div>
            <div>
               <input name="res_hascoursedoc" type="radio" value="0" />无
            </div>            
         </div>
         <div class="content-con3">
            <span class="bttext">课外阅读资源:</span>
            <div>
               <input name="res_hasreadingres" type="radio" value="1" checked="checked" />有
            </div>
            <div>
               <input name="res_hasreadingres" type="radio" value="0" />无
            </div>            
         </div>             
         <div class="content-con1">
            <span class="bttext">课程时长:</span><input type="text" id="res_length" name="res_length" />
         </div>
         <div class="content-con2">
            <span class="bttext">图片:</span>
            <div class="scpic">
                <button id="addLabProdPic">请上传图片</button>
                <div id="img_div">
                	
                </div>
            </div>
         </div>        
         <div class="clear"></div>
         <div class="bcbutton1"><a href="###" class="bccg">保存为草稿</a>
        	<input type="button" value="提交" onclick="AjaxSubmit();"  /></div> 
        	<input type="hidden" id="img_id_list" name="img_id_list" />
         </form>
      </div>
   </div>
</div>
<div class="clear"></div>
<div class="pages">
        <div id="Pagination"></div>
        <div class="searchPage">
          <span class="page-sum">共<strong class="allPage">15</strong>页</span>
          <span class="page-go">跳转<input type="text">页</span>
          <a href="javascript:;" class="page-btn">GO</a>
        </div>
        <div class="clear"></div>
</div>   
<script type="text/javascript" src="js/left.js"></script>
<script type="text/javascript" src="js/nav.js"></script>
<div id="sign_up">
     <h3 id="see_id" class="sprited" >&nbsp;</h3>
     <span>用户登录</span>
     <div id="sign_up_form">
          <input class="sprited" placeholder="请输入手机号码或邮箱或用户名"/>
          <input class="sprited" placeholder="请输入密码"/><br />
          <div class="jzma">
               <input type="checkbox" />    
               <span style="color:gray;" style="font-size:14px;">记住用户名</span>                  
                <a href="###" class="wjma">忘记密码？</a>
           </div>
           <a href="###" class="button">立即登录</a><br />
           <div class="box1">
              <span class="con">还不是我们的用户？</span>
              <a href="###" class="zc">立即注册</a>
           </div> 
        </div>                  
</div>
</body>
</html>
